//
//  RegisterView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/2/27.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "RegisterView.h"
#import <Masonry.h>
@implementation RegisterView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    NSLog(@"注册页面");
    self.phonoNumView = [[UIView alloc] init];
    [self addSubview:self.phonoNumView];
    [self.phonoNumView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(25);
        make.right.mas_equalTo(-25);
        make.height.mas_equalTo(44);
        make.top.equalTo(self).offset(30);
    }];
    
    self.phonoLab = [[UILabel alloc] init];
    self.phonoLab.text = @"手机号";
    self.phonoLab.font = [UIFont systemFontOfSize:16.0f];
    self.phonoLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    [self.phonoNumView addSubview:self.phonoLab];
    [self.phonoLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.phonoNumView);
        make.centerY.equalTo(self.phonoNumView);
        make.width.mas_equalTo(50);
    }];
    
    self.phonoNumTf = [[UITextField alloc] init];
    self.phonoNumTf.placeholder = @"您的手机号";
    self.phonoNumTf.font = [UIFont systemFontOfSize:16.0f];
    self.phonoNumTf.textAlignment = NSTextAlignmentLeft;
    self.phonoNumTf.keyboardType = UIKeyboardTypeNumberPad;
    self.phonoNumTf.clearButtonMode = UITextFieldViewModeWhileEditing;
    [self.phonoNumView addSubview:self.phonoNumTf];
    [self.phonoNumTf mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.phonoLab.mas_right).offset(30);
        make.centerY.equalTo(self.phonoNumView);
        make.right.equalTo(self.phonoNumView).offset(-10);
        make.height.equalTo(self.phonoNumView);
    }];
    
    self.phonoLineView = [[UIView alloc] init];
    self.phonoLineView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 /255.0 blue:229 / 255.0 alpha:1];
    [self.phonoNumView addSubview:self.phonoLineView];
    [self.phonoLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.phonoNumView);
        make.right.equalTo(self.phonoNumView);
        make.bottom.equalTo(self.phonoNumView);
        make.height.mas_equalTo(1);
    }];
    
    
    self.securityCodeView = [[UIView alloc] init];
    [self addSubview:self.securityCodeView];
    [self.securityCodeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(25);
        make.right.mas_equalTo(-25);
        make.height.mas_equalTo(44);
        make.top.equalTo(self.phonoLineView.mas_bottom).offset(10);
    }];
    
    self.securityCodeLab = [[UILabel alloc] init];
    self.securityCodeLab.text = @"验证码";
    self.securityCodeLab.font = [UIFont systemFontOfSize:16.0f];
    self.securityCodeLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    [self.securityCodeView addSubview:self.securityCodeLab];
    [self.securityCodeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.securityCodeView);
        make.centerY.equalTo(self.securityCodeView);
        make.width.mas_equalTo(50);
    }];
    
    
    
    self.securityCodeLineView = [[UIView alloc] init];
    self.securityCodeLineView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 /255.0 blue:229 / 255.0 alpha:1];
    [self.securityCodeView addSubview:self.securityCodeLineView];
    [self.securityCodeLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.securityCodeView);
        make.right.equalTo(self.securityCodeView);
        make.bottom.equalTo(self.securityCodeView);
        make.height.mas_equalTo(1);
    }];
    
    self.sendSMSBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.sendSMSBtn setTitle:@"发送验证码" forState:(UIControlStateNormal)];
    [self.sendSMSBtn setTitleColor:[UIColor colorWithRed:49/255.0 green:138/255.0 blue:255/255.0 alpha:1.0] forState:(UIControlStateNormal)];
    self.sendSMSBtn.titleLabel.font = [UIFont systemFontOfSize:14.0f];
    [self.securityCodeView addSubview:self.sendSMSBtn];
    [self.sendSMSBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.securityCodeLineView);
        make.centerY.equalTo(self.securityCodeView);
        make.width.mas_equalTo(75);
    }];
    
    self.verticalLineView = [[UIView alloc] init];
    self.verticalLineView.backgroundColor = [UIColor colorWithRed:229 / 255.0 green:229 / 255.0 blue:229 / 255.0 alpha:1];
    [self.securityCodeView addSubview:self.verticalLineView];
    [self.verticalLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.sendSMSBtn.mas_left).offset(-10);
        make.centerY.equalTo(self.securityCodeView);
        make.top.mas_equalTo(10);
        make.width.mas_equalTo(1);
    }];
    
    self.securityCodeNumTf = [[UITextField alloc] init];
    self.securityCodeNumTf.placeholder = @"短信验证码";
    self.securityCodeNumTf.keyboardType = UIKeyboardTypeNumberPad;
    self.securityCodeNumTf.font = [UIFont systemFontOfSize:16.0f];
    self.securityCodeNumTf.textAlignment = NSTextAlignmentLeft;
    self.securityCodeNumTf.clearButtonMode = UITextFieldViewModeWhileEditing;
    [self.securityCodeView addSubview:self.securityCodeNumTf];
    [self.securityCodeNumTf mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.securityCodeLab.mas_right).offset(30);
        make.centerY.equalTo(self.securityCodeView);
        make.right.equalTo(self.verticalLineView.mas_left).offset(-10);
        make.height.equalTo(self.securityCodeView);
    }];
    
    
    self.nextStepBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.nextStepBtn setTitle:@"下一步" forState:(UIControlStateNormal)];
    self.nextStepBtn.userInteractionEnabled = NO;
    [self.nextStepBtn setTitleColor:[UIColor whiteColor]forState:(UIControlStateNormal)];
    self.nextStepBtn.titleLabel.font = [UIFont systemFontOfSize:16.0];
    self.nextStepBtn.backgroundColor = [UIColor colorWithRed:219/255.0 green:224/255.0 blue:255/255.0 alpha:1.0];
    self.nextStepBtn.layer.cornerRadius = 22;
    [self addSubview:self.nextStepBtn];
    [self.nextStepBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.securityCodeLineView.mas_bottom).offset(40);
        make.left.mas_equalTo(25);
        make.right.mas_equalTo(-25);
        make.height.mas_equalTo(44);
    }];
    
    
}

@end
